package tests;

/**
 * @author 李夏
 * @version 1.0
 */

import common.Utils;
import org.openqa.selenium.By;

import java.io.IOException;
import java.lang.reflect.Method;

/**
 * 论坛列表页测试
 */
public class ForumListPage extends Utils {
        public static String url = "http://127.0.0.1:58080/index.html";
        public ForumListPage() {
            super(url);
        }

        /*
        检查页面是否加载成功
         */
        public void  forumListPageRight() throws InterruptedException, IOException {
            LoginPage loginPage=new LoginPage();
            loginPage.loginSuc();
            //通过查看页面元素是否存在来检查页面加载成功与否
            driver.findElement(By.cssSelector("#nav_board_index > a > span.nav-link-title"));
            driver.findElement(By.cssSelector("body > div.page > header.navbar.navbar-expand-md.navbar-light.d-print-none > div > div > div.nav-item.d-none.d-md-flex.me-3 > div > form > div > input"));
            Method method = new Object() {
            }.getClass().getEnclosingMethod();
            String methodName = method.getName();
            getScreenShot(getClass().getName(),methodName);
        }
}
